<?php

namespace app\http\middleware;

use think\Controller;
use think\Db;
class Check extends Controller
{
    public function handle($request, \Closure $next)
    {
        //userid -1 不判断 userid="" 提示401
        $userid = $request->header("userid");
        if (isset($userid)) {
            if($userid!=-1){
                if(strlen($userid)==0){
                    return json(array("data"=>"","error"=>"UNLOGIN","code"=>401),401);
                }

            }
        }
        return $next($request);
    }
}
